#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>

void print_opt(char ch)
{
	printf("arg: %c val:%s\n", ch, optarg);
}


int main(int argc, char *argv[])
{
	int opt = 0;
	// a   no args
	// b:  args is MUST
	// c:: args is OPTIONAL
	while((opt = getopt(argc, argv, "c")) != -1) {
		//print_opt(opt);
		printf("%c\n", opt);
		switch(opt) {
			case 'c':
				printf("%c\n", 'c');
				break;
			case 'C':
				printf("%c\n", 'C');
				break;
			case 'b':
				printf("%b\n", 'C');
				break;
			default:
				printf("fail\n", 'C');
				break;
				
		}
	}

	return 0;
}
